<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@ include file="/web/header.jsp"%>
<title>Insert title here</title>
</head>
<body>
	<fieldset id="">
		<legend>信息修改</legend>
		<div class="layui-field-box">
			<form action="" class="layui-form layui-form-pane" lay-filter="formA"
				method="post">
				<div class="layui-form-item">
					<label class="layui-form-label">项目代码</label>
					<div id="" class="layui-input-inline">
						<input type="text" name="code" id="" readonly class="layui-input"
							lay-verify="required" placeholder="请输入项目代码" />
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">项目名称</label>
					<div id="" class="layui-input-inline">
						<input type="text" name="name" id="" class="layui-input"
							lay-verify="required" placeholder="请输入项目名称" />
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">项目起始时间</label>
					<div id="" class="layui-input-inline">
						<input type="text" name="time" id="time" class="layui-input"
							lay-verify="required" placeholder="请输入时间" />
					</div>
				</div>
				<div class="layui-form-item">
					<div id="" class="layui-input-inline">
						<input type="button" name="" id="" value="确定" class="layui-btn"
							lay-submit lay-filter="upd" /> <input type="button" name=""
							id="" value="取消" onclick="closeThis()" class="layui-btn " />
						<!-- 						<input type="reset" name="" id="" value="重置" class="layui-btn layui-btn-primary" /> -->
					</div>

				</div>
				<input type="hidden" name="action" id="" value="upd" />
			</form>
		</div>

	</fieldset>
	
	<script type="text/javascript">
		var code = '<%=request.getParameter("code")%>';
		a();
		function a(){
			renderDate("time");
		}
		function renderDate(id){
			laydate.render({
				elem:"#"+id,
				type:"datetime",
				
				
			})
		}
		init();
		function init(){
			ajax("/ProjectServlet",{action:"get",code:code},"json",function(aaa){
				form.val("formA",{code:aaa.code,name:aaa.name,time:aaa.time})
			})
		}
		
		formSubmit("/ProjectServlet","submit(upd)","text",function(data){
			if(data==1){
				layer.msg("修改成功",closeThis)
			}else{
				layer.msg("修改失败")
			}
		})
		
		
	</script>
</body>
</html>